package com.jqb.webservice.client;

import java.net.MalformedURLException;
import java.net.URL;
import javax.xml.namespace.QName;
import com.jqb.webservice.service.MathService;
import com.jqb.webservice.service.MathServiceImplService;

public class Client02 {
	public static void main(String[] args) throws MalformedURLException {
		/*方式一
		MathServiceImplService mis = new MathServiceImplService();
		MathService mathService = mis.getMathServiceImplPort();
		System.out.println(mathService.add(12, 2));
		*/
		
		/*方式二(使用tcpmon截获soap消息) [并使用wsimport 命令生成的java类MathServiceImplService]*/
		URL url = new URL("http://localhost:9999/math?wsdl");
		QName qname = new QName("http://service.webservice.jqb.com/","MathServiceImplService");
		MathServiceImplService mis = new MathServiceImplService(url,qname);
		MathService mathService = mis.getMathServiceImplPort();
		System.out.println(mathService.add(12, 2));
		System.out.println(mathService.login("admin", "admin"));
	}
}
